package realQuestion.dajiang;

import java.util.*;

public class Solution2 {

    /* Write Code Here */
    public int[] calculateFinalPositi(String instructions) {
        int x=0;
        int y=0;
        char[] chars = instructions.toCharArray();
        for (char c : chars) {
            switch (c){
                case 'U':
                    y++;
                    break;
                case  'D':
                    y--;
                    break;
                case  'R':
                    x++;
                    break;
                case 'L':
                    x--;
                    break;

            }

        }
        return  new int[]{x,y};


    }
}

 class Main1 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int[] res;

        String instructions;
        try {
            instructions = in.nextLine();
        } catch (Exception e) {
            instructions = null;
        }

        res = new Solution2().calculateFinalPositi(instructions);
        for(int res_i=0; res_i < res.length; res_i++) {
            System.out.println(String.valueOf(res[res_i]));
        }

    }
}
